#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Create Redis Cluster
#Author:haipenge
#Date:2018.05.15

import logging
import shutil
import tempfile
import time
import random
import sys
import os


class Cluster(object):
	@property
	def hosts(self):
		return self._hosts
	@hosts.setter
	def hosts(self,hosts):
		self._hosts=hosts
	@property
	def ports(self):
		return self._ports
	@ports.setter
	def ports(self,ports):
		self._ports=ports
	#拼装Redis Cluster 搭建命令
	def generate_cmds(self):
		print 'run generate'
		cmds=''
		for host,port in zip(self.hosts,self.ports):
			cmds += host + ':' + port
		print cmds

if __name__ == '__main__':
	cluster = Cluster()
	cluster.hosts=['10.11.100.181','10.11.100.182','10.11.100.183','10.11.100.47','10.11.100.48','10.11.100.49']
	cluster.ports=['8000','8001','8002','8003','8004','8005','8006','8007','8008','8009']
	print cluster.hosts
	print cluster.ports
	cluster.generate_cmds